<html xmlns:th="http://www.thymeleaf.org"  
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"    
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">    
<html>
<head th:include="common/common::header">
    <meta charset="UTF-8">
    <style type="text/css">
      #index {
            justify-content: space-between;
            flex-wrap: wrap;
            opacity: 0;
        }
        .index-l {
            width: 100%;
            margin-top: 0.5%;
            margin-left: 29px;
        }
    </style>
</head>

<body>
		 <div class="form-item" style="margin-top: 0.5%">
			       <label for="" style=" padding-left: 28%;" class="label-top" >表名：</label>
			       <input  type="text" class="easyui-textbox" id="gen_tableName"/>
		      		<a onclick="searchgen()"   href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true">搜索</a>
		  </div>
		<div class="index-l" id="genToolbar">
	      <div>
	      	<shiro:hasPermission name="sys:gen:do">
       		  <a href="javascript:void(0)" onclick="openSelects({title:'代码生成-执行',width:'30%',height:'50%',checkSelect:true,gridId:'gebTable',url:'system/gen/add_01',onClose:searchgen})"  class="easyui-linkbutton error" id="reedit" data-options="iconCls:'fa fa-eye'">代码生成</a>
       		</shiro:hasPermission>
       		  <a href="javascript:void(0)" onclick="searchgen()" id="rebreak" class="easyui-linkbutton success" data-options="iconCls:'fa fa-refresh'">刷新</a>
	      </div>
	      </div>
	      <div style="opacity: 1;width:100%;min-height:780px;margin-top: 0.5%">
	        <table id="gebTable" style="opacity: 1;width:100%;height:780px;margin-top: 2%" class="easyui-datagrid"  th:attr="data-options=${dataGrid }">
			</table>
	</div>
<script type="text/javascript">
function searchgen(){
		AM.gridSearch({
		gridId:'gebTable',
		data:[
			  {field:'tableName',type:'textbox',id:'gen_tableName'}
		     ]
	});
}

function genDo(url) {
	var gen=new Array()
	var array = $('#gebTable').datagrid('getSelections');
	if(array.length == 0 || array==null){
		parent.layer.msg("请选择一行或多行数据",{icon:7,time:3000});
		return ;
	}
	console.log(array)
	for (var i=0;i<array.length;i++){
		gen.push(array[i].tableName);
	}
	console.log(gen)
	  jQuery('<form action="'+url+'" method="post">' +
         	 '<input type="text" name="tables" value="'+gen+'"/>' +
     	     '</form>')
 .appendTo('body').submit().remove();
}
</script>
</body>
</html>